package com.kyxx.mycommonproject.dianpu;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.kyxx.mycommonproject.R;

public class GridViewAdapter extends RecyclerView.Adapter<GridViewAdapter.ViewHolder> {

    private Context mContext;

    public GridViewAdapter(Context mContext) {
        this.mContext = mContext;
    }

    @Override
    public GridViewAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view =
                LayoutInflater.from(parent.getContext()).inflate(R.layout.item_gridview_good, parent, false);
        return new ViewHolder(view);
    }

    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    @Override
    public void onBindViewHolder(final GridViewAdapter.ViewHolder holder, int position) {
        holder.tv_good.setText(position+"潮诺聚合物苹果移动电源5s充电宝10000毫安以上通用三星小米 金色 天书");
    }

    @Override
    public int getItemCount() {
        return 20;
    }

    public static class ViewHolder extends RecyclerView.ViewHolder {
        private TextView tv_good;
        private ImageView iv_good;
        private TextView tv_price;

        public ViewHolder(View view) {
            super(view);
            tv_good =(TextView) view.findViewById(R.id.tv_good);
            iv_good=(ImageView) view.findViewById(R.id.iv_good);
            tv_price=(TextView) view.findViewById(R.id.tv_price);
        }
    }
}
